namespace Expect.Documentation.Base_concepts
{
    using System;
    using Expect.Core;
    using Expect.Core.Fixtures;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    
    
    // This file is generated, if you modify content you will lose your modifications when the generator will regenerate the file
    [System.CodeDom.Compiler.GeneratedCodeAttribute("Expect.Core", "0.5.2.0")]
    [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [TestClass()]
    [SpecificationContainerAttribute(Name="Multiple specifications in a file", Path="\\Base concepts\\Multiple specifications in a file.expect")]
    public partial class MultipleSpecificationsInAFileContainer : Expect.Core.AbstractSpecificationContainer
    {
        
        partial void PrepareContextExtension();
        
        partial void BeforeInitExtension();
        
        partial void AfterInitExtension();
        
        partial void BeforeTeardownExtension();
        
        partial void AfterTeardownExtension();
        
#line 1 "Multiple specifications in a file.expect"
#line hidden
        
        public override void InitializeContext()
        {
            base.InitializeContext();
            PrepareContextExtension();
        }
        
        [TestInitialize()]
        public virtual void MultipleSpecificationsInAFileClass_TestInit()
        {
            InitializeContext();
            BeforeInit();
            BeforeInitExtension();

            SpecificationDefinition spec = new SpecificationDefinition();
            Get_SpecificationsInitialization(spec);
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }

            AfterInit();
            AfterInitExtension();
        }
        
        [SetupProviderAttribute(Name="Specifications initialization")]
        public virtual void Get_SpecificationsInitialization(Expect.Core.SpecificationDefinition spec)
        {
            spec.Context = Context;
            spec.Name = "Specifications initialization";
            FixtureDefinition fixture = null;

            fixture = spec.AddFixture<DescriptionFixture>();
#line 2
            fixture.WithRow("You could have multiple specifications in a single file. This is the case here, w" +
                    "here each subchapter is a specification defined in the same file.");
#line 3
            fixture.WithRow("You write this using blocs delimiters. Blocs could be \"@setup\", \"@specification\"," +
                    " or \"@teardown\", followed by the name of the element.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 5
            fixture.WithRow("You could have only one setup bloc in a single file. A setup bloc is declared lik" +
                    "e this:");
#line 6
            fixture.WithRow("{{");
#line 7
            fixture.WithRow("@setup Specifications initialisation");
#line 8
            fixture.WithRow("}}");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 10
            fixture.WithRow("Fixtures in @setup bloc are executed before each specification in the file. ");
#line 11
            fixture.WithRow("!As an example :!");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture();
#line 12
            fixture.WithRow("This sentence is executed before each specification");
#line hidden
            fixture.EndRun();

        }
        
        [TestCleanup()]
        public virtual void MultipleSpecificationsInAFileClass_TestTeardown()
        {
            BeforeTeardown();
            BeforeTeardownExtension();

            SpecificationDefinition spec = new SpecificationDefinition();
            Get_Finalisation(spec);
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }

            AfterTeardown();
            AfterTeardownExtension();
        }
        
        [TeardownProviderAttribute(Name="Finalisation")]
        public virtual void Get_Finalisation(Expect.Core.SpecificationDefinition spec)
        {
            spec.Context = Context;
            spec.Name = "Finalisation";
            FixtureDefinition fixture = null;

            fixture = spec.AddFixture<DescriptionFixture>();
#line 38
            fixture.WithRow("As you probably guessed, fixtures in @teardown are executed after each specificat" +
                    "ion.");
#line 39
            fixture.WithRow("The file could have only one teardown bloc, for example :");
#line 40
            fixture.WithRow("{{");
#line 41
            fixture.WithRow("@teardown Finalisation");
#line 42
            fixture.WithRow("}}");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 44
            fixture.WithRow("!As an example :!");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture();
#line 45
            fixture.WithRow("This sentence is executed after each specification");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 47
            fixture.WithRow("If you look at the code for this specifications, you will see some other interest" +
                    "ing implementation concepts, like exchanging data between Expect elements throug" +
                    "h the Context property of containers and specifications classes.");
#line hidden
            fixture.EndRun();

        }
        
        // TestComment
        [TestMethod()]
        public virtual void MultipleSpecificationsInAFile_SpecificationBlocs()
        {
            SpecificationDefinition spec = new SpecificationDefinition();
            Get_SpecificationBlocs(spec);
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }
        }
        
        [SpecificationProviderAttribute(Name="Specification blocs")]
        public virtual void Get_SpecificationBlocs(Expect.Core.SpecificationDefinition spec)
        {
            spec.Context = Context;
            spec.Name = "Specification blocs";
            FixtureDefinition fixture = null;

            fixture = spec.AddFixture<DescriptionFixture>();
#line 15
            fixture.WithRow("You could have multiple specification blocs within a file. Each specification sho" +
                    "uld have a unique name. A specification bloc is declared like this :");
#line 16
            fixture.WithRow("{{");
#line 17
            fixture.WithRow("@specification Specification blocs");
#line 18
            fixture.WithRow("}}");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture();
#line 20
            fixture.WithRow("This sentence is executed within a specification bloc");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture();
#line 22
            fixture.WithRow("The call must come from", "Container", "");
#line hidden
            fixture.EndRun();

        }
        
        // TestComment
        [TestMethod()]
        public virtual void MultipleSpecificationsInAFile_SpecificationClasses()
        {
            SpecificationDefinition spec = new SpecificationDefinition();
            Get_SpecificationClasses(spec);
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }
        }
        
        [SpecificationProviderAttribute(Name="Specification classes")]
        public virtual void Get_SpecificationClasses(Expect.Core.SpecificationDefinition spec)
        {
            spec.Context = Context;
            spec.Name = "Specification classes";
            FixtureDefinition fixture = null;

            fixture = spec.AddFixture<DescriptionFixture>();
#line 25
            fixture.WithRow("Fixture methods can be mapped to specification classes. For this, you must create" +
                    " a class named after the specification.");
#line 26
            fixture.WithRow("For example, this bloc is named \"Specification classes\", so I could create a clas" +
                    "s called \"SpecificationClasses\" and put fixture methods in it. A specification c" +
                    "lass should implement ISpecificationImplementation.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 28
            fixture.WithRow("if you have a method with the same name in specification class and container, Exp" +
                    "ect will run the one in the specification class.");
#line 29
            fixture.WithRow("Setup and Teardown could also use specification classes.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture();
#line 31
            fixture.WithRow("This sentence is executed within a specification bloc");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture();
#line 33
            fixture.WithRow("The call must come from", "Specification class", "");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 35
            fixture.WithRow("In this specification, the first sentence is resolved through a specification cla" +
                    "ss, unlike the specification in the previous chapter that resolve the same sente" +
                    "nce in the container.");
#line hidden
            fixture.EndRun();

        }
    }
}
